# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1SecurityGateway do
  @moduledoc """
  Information about a BeyoncCorp SecurityGateway resource.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when the resource was created.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. An arbitrary user-provided name for the SecurityGateway. Cannot exceed 64 characters.
  *   `externalIps` (*type:* `list(String.t)`, *default:* `nil`) - Output only. IP addresses that will be used for establishing connection to the endpoints.
  *   `hubs` (*type:* `%{optional(String.t) => GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1Hub.t}`, *default:* `nil`) - Optional. Map of Hubs that represents regional data path deployment with GCP region as a key.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Name of the resource.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The operational state of the SecurityGateway.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when the resource was last modified.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :displayName => String.t() | nil,
          :externalIps => list(String.t()) | nil,
          :hubs =>
            %{
              optional(String.t()) =>
                GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1Hub.t()
            }
            | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:displayName)
  field(:externalIps, type: :list)

  field(:hubs,
    as: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1Hub,
    type: :map
  )

  field(:name)
  field(:state)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder,
  for: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1SecurityGateway do
  def decode(value, options) do
    GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1SecurityGateway.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1SecurityGateway do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
